package net.edu_soft.ec.asset.mapper;

import java.util.List;
import net.edu_soft.ec.asset.pojo.UserInfo;
import net.edu_soft.ec.asset.pojo.UserInfoExample;
import net.edu_soft.ec.asset.pojo.bo.UserPermission;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserInfoMapper {
    long countByExample(UserInfoExample example);

    int deleteByExample(UserInfoExample example);

    int deleteByPrimaryKey(Integer userInfoId);

    int insert(UserInfo record);

    int insertSelective(UserInfo record);

    List<UserInfo> selectByExample(UserInfoExample example);

    UserInfo selectByPrimaryKey(Integer userInfoId);

    int updateByExampleSelective(@Param("record") UserInfo record, @Param("example") UserInfoExample example);

    int updateByExample(@Param("record") UserInfo record, @Param("example") UserInfoExample example);

    int updateByPrimaryKeySelective(UserInfo record);

    int updateByPrimaryKey(UserInfo record);

    /***
     * 根据角色id查询该角色权限
     * @param roleId 角色id
     * @return 角色信息及权限列表
     */
    UserPermission selPermission(Integer roleId);

    /***
     * 根据用户账号查询用户信息
     * @param username 用户账号
     * @return 用户信息
     */
    UserInfo findByUserName(@Param("username")String username);

}